<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>角色分配</title>
<%@ include file="/resources/jsp/rootPath.jsp"%>
</head>
<body>
	<%@ include file="/resources/jsp/header.jsp"%>

	<!-- content start -->
	<div class="am-cf admin-main">
		<%@ include file="/resources/jsp/left.jsp"%>
		<!-- content start -->
		<div class="admin-content">
			<form action="${root}/sys/organization/saveSysAuthRolePerson.do" method="post">
				<input type="hidden" name="fdId" value="${role.fdId}"/>
				<div class="am-cf am-padding">
					<div class="am-fl am-cf">
						<strong class="am-text-primary am-text-lg">表单</strong> / <small>form</small>
					</div>
				</div>

				<div class="am-tabs am-margin" data-am-tabs>
					<ul class="am-tabs-nav am-nav am-nav-tabs">
						<li class="am-active"><a href="#tab1">角色分配</a></li>
					</ul>

					<div class="am-tabs-bd">
						<div class="am-tab-panel am-fade am-in am-active" id="tab1">
							
							<div class="am-g am-margin-top">
								<div class="am-u-sm-4 am-u-md-2 am-text-right">角色分配人员</div>
								<div class="am-u-sm-8 am-u-md-10">
									<textarea readonly="readonly" class="" cols="50" rows="3" id="fdOrgElementsName" name="fdOrgElementsName"><c:forEach items="${role.fdOrgElements }" var="person">${person.fdName };</c:forEach></textarea>
									<input type="hidden" id="fdOrgElementsId" name="fdOrgElementsId" value="${fdOrgElementsId }">
									<button type="button" class="am-btn am-btn-primary am-btn-xs" onclick="sendPerson()">
									<i class="am-icon-cog"></i>设置
									</button>
								</div>
							</div>


						</div>



					</div>
				</div>

				<div class="am-margin">
					<button type="button" onclick="submit()" class="am-btn am-btn-primary am-btn-xs">提交保存</button>
					<button type="button" onclick="cancle()" class="am-btn am-btn-primary am-btn-xs">放弃保存</button>
				</div>
			</form>
		</div>

	</div>
	<!-- 设置人员TEMP -->
	<span id="personList"></span>
	<%@ include file="/resources/jsp/foot.jsp"%>
</body>
<script type="text/javascript">
	function submit(){
		$("form").submit();
	}

	function cancle(){
		window.location.href="${root}/sys/organization/sysAuthRole.do";
	}
	
	function sendPerson(){
		$.ajax({
			type: "POST",
			url: "${root}/sys/organization/getSysAuthRolePerson.do",
			success: function(data){
				$("#personList").html(data);
				var $modal = $('#personListModel');
				$modal.modal('open');
			},
			cache: false,
			dataType: 'html'
		});
		
	}
</script>
</html>